<template>
  <div class="app-container">
    <div class="layout-padding-auto layout-padding-view">
      <div class="domTitle">


        <span class="el-dropdown-link">
          我的作品<i class="el-icon-caret-bottom"></i>
        </span>

      </div>

      <div class="domContainer" v-loading="loading">
        <div class="drafts">
          <div class="draftsTop">
            <el-tabs v-model="queryParams.dataType" @tab-click="handleCommand">
              <el-tab-pane label="文章" name="article"></el-tab-pane>
              <el-tab-pane label="视频" name="shortVideo"></el-tab-pane>
            </el-tabs>
            <div class="groupdraftsBtn" @click="groupdraftsShow = !groupdraftsShow">
              <img src="@/assets/images/qh.png" alt="">
              切换
            </div>
            <div class="listTab">
              <div :class="listTabName == item.id ? 'listTabShow' : ''" v-for="(item, index) in auditStatusList"
                :key="index" @click="listTabClick(item)">
                {{ item.name }}</div>
            </div>
            <div class="draftsNum">当前 {{ listDataNum }} 条内容 <span> 部分统计数据可能稍有延迟，将于早上8点前更新完成</span></div>

          </div>

          <div class="draftsList" v-if="groupdraftsShow" ref="scrollContainer" @scroll="handleScroll">
            <div class="draftsDom" v-for="(item, index) in listData" :key="index">
              <div class="draftsDomLeft">
                <div class="draftsDomLeftImg">
                  <img v-if="item.dataType == 'article' && item.data.imgPics" :src="item.data.imgPics[0]" alt="" />
                  <div class="videoImg" v-if="item.dataType == 'shortVideo'">
                    <img class="imgB" :src="item.data.imgPic" controls alt=""></img>
                    <img class="frame" src="@/assets/images/Frame.png" controls alt=""></img>
                  </div>
                  <div class="imgNull"
                    v-if="item.data.imgPic == undefined && item.dataType == 'shortVideo' || item.data.imgPics == undefined && item.dataType == 'article'">
                    <img src="@/assets/images/imgNull.png" alt="">
                    <div>无封面</div>
                  </div>
                </div>
                <div class="draftsText">
                  <div>
                    <h4>{{ item.data.title }}</h4>
                  </div>
                  <div class="draftsCon" v-if="item.dataType != 'shortVideo'">
                    {{ item.data.contentText || '[ 无内容 ]' }}
                  </div>
                  <div class="draftsType">
                    <!-- published -> 显示发布时间
                      violated -> 显示涉嫌违规
                      rejected -> 显示审核不通过
                      pending -> 显示审核中 -->
                    <span class="privacyFlag" v-if="item.data.privacyFlag == 1">仅我可见</span>
                    <span v-if="item.displayStatus == 'published'" style="color: #66DF59;">已发布</span>
                    <span v-if="item.displayStatus == 'violated'" style="color: #E94148;">涉嫌违规</span>
                    <span v-if="item.displayStatus == 'rejected'" style="color: #E94148;">审核不通过</span>
                    <span v-if="item.displayStatus == 'pending'" style="color: #EE9922;">审核中</span>
                  </div>

                  <!-- <div v-if="item.displayStatus == 'rejected'" class="riskTips">原因：{{ item.riskTips }}</div> -->
                  <!-- <el-tooltip placement="top-start">
                    <div slot="content" v-if="item.sensitiveDetails">

                      <div v-for="(tipItem, index) in item.sensitiveDetails.image">
                        <div v-if="tipItem.riskLevel != 'none'"> 图片{{ index + 1 }}：{{ tipItem.riskTips }}</div>
                      </div>
                      <div v-for="(tipItemtext, index) in item.sensitiveDetails.text">
                        <div v-if="tipItemtext.riskLevel == 'none'">
                          <span>{{ tipItemtext.itemKey == 'title' ? "标题" : "内容" }}：{{ tipItemtext.riskTips }}</span>
                        </div>
                      </div>
                      <div v-for="(tipItemtext, index) in item.sensitiveDetails.video">
                        <div v-if="tipItemtext.riskLevel == 'none'">
                          <span>视频: </span>
                          <span>{{ tipItemtext.riskTips }}</span>
                        </div>
                      </div>
                    </div>
                     
                  </el-tooltip> -->
                    <div v-if="item.displayStatus == 'rejected'" class="riskTips" @click="violationInfoDom(item)">原因：{{ item.riskTips }} </div>
                  <div class="draftsConCount">
                    <span>点赞：{{ item.data.likeCount }}</span>
                    <span>评论：{{ item.data.commentCount }}</span>
                    <span>分享：{{ item.data.shareCount ? item.data.shareCount : 0 }}</span>
                    <span>收藏：{{ item.data.collectCount }}</span>
                    <span>预览: {{ item.data.previewCount }} </span>
                  </div>
                </div>
              </div>

              <div class="draftsDetails">
                <div class="draftsTime">
                  发布时间：{{ formatDate(parseInt(item.createTimestamp)) }}
                </div>
                <div class="draftsBtn">
                  <!-- <div>
                      <el-button size="mini" type="primary">编辑</el-button>
                    </div> -->
                  <div>
                    <el-button size="mini" type="text" @click.stop="userWorksPinned(item, index)">
                      {{ item.pinnedFlag == 0 ? "置顶" : "取消置顶" }}
                    </el-button>
                  </div>
                  <div>
                    <el-button size="mini" type="text" @click.stop="userWorksPrivate(item, index)">
                      {{ item.data.privacyFlag == 0 ? "设为仅我可见" : "设为公开" }}
                    </el-button>
                  </div>
                  <div @click.stop="details(item)">
                    <el-button size="mini" type="text" class="det">查看详情</el-button>
                  </div>
                  <div>
                    <el-button size="mini" type="text" class="det" @click.stop="Deleteopen(item,index)">删除作品</el-button>
                  </div>
                </div>
              </div>
            </div>
            <div v-if='draftsListNullShow' class="draftsListNull">
              暂无作品
            </div>
          </div>
          <div class="groupdrafts" v-if="!groupdraftsShow" ref="scrollContainer" @scroll="handleScroll">
            <div class="groupdraftsDom" v-for="(item, index) in listData" :key="index">
              <div class="domImg">
                <img v-if="item.dataType == 'article' && item.data.imgPics" :src="item.data.imgPics[0]" alt="" />
                <img v-if="item.dataType == 'shortVideo'" :src="item.data.imgPic" controls alt=""></img>
                <img v-if="item.dataType == 'shortVideo'" class="frame" src="@/assets/images/Frame.png" controls alt=""
                  @click.stop="playVideo(item)"></img>
                <div class="imgNull"
                  v-if="item.data.imgPic == undefined && item.dataType == 'shortVideo' || item.data.imgPics == undefined && item.dataType == 'article'">
                  <img src="@/assets/images/imgNull.png" alt="">
                  <div>无封面</div>
                </div>
                <div class="operation" @click.stop="operationClick(item, 'show')">操作</div>
              </div>
              <div class="title">
                {{ item.data.title }}
              </div>
              <div class="draftsCon" v-if="item.dataType != 'shortVideo'">
                {{ item.data.contentText || '[ 无内容 ]' }}
              </div>
              <div class="draftsType">

                <span class="privacyFlag" v-if="item.data.privacyFlag == 1">仅我可见</span>
                <span v-if="item.displayStatus == 'published'" style="color: #66DF59;">已发布</span>
                <!-- <span v-if="item.displayStatus == 'violated'" style="color: #E94148;">涉嫌违规</span> -->
                <span v-if="item.displayStatus == 'rejected'" style="color: #E94148;">审核不通过 </span>
                <span v-if="item.displayStatus == 'pending'" style="color: #EE9922;">审核中</span>
              </div>

              <!-- <el-tooltip placement="top-start" hide-after="0" >
                <div slot="content" style="max-width:300px;">
                  <div v-if="item.sensitiveDetails">
                    <div v-for="(tipItem, index) in item.sensitiveDetails.image">
                      <div v-if="tipItem.riskLevel != 'none'"> 封面：{{ tipItem.riskTips }}</div>
                    </div>
                    <div v-for="(tipItemtext, index) in item.sensitiveDetails.text">
                      <div v-if="tipItemtext.riskLevel != 'none'">
                        <span>标题：{{ tipItemtext.riskTips }}</span>
                      </div>
                    </div>
                    <div v-for="(tipItemtext, index) in item.sensitiveDetails.video">
                      <div v-if="tipItemtext.riskLevel != 'none'">
                        <span>视频: </span>
                        <span>{{ tipItemtext.riskTips }}</span>
                      </div>
                    </div>
                  </div>
                </div>
             


              </el-tooltip> -->
              <div v-if="item.displayStatus == 'rejected'" class="riskTips" @click="violationInfoDom(item)">原因：{{
                item.riskTips }}
              </div>
              <div class="timestamp">
                <span> 发布时间：{{ formatDate(parseInt(item.createTimestamp)) }}</span>
              </div>
              <div class="draftsNum">
                <div class="num">
                  <div class="numDiv">
                    <span>点赞</span>
                    <span>{{ item.data.likeCount }}</span>·
                  </div>
                  <div class="numDiv">
                    <span>评论</span>
                    <span>{{ item.data.commentCount }}</span>·
                  </div>
                  <div class="numDiv">
                    <span>分享</span>
                    <span>{{ item.data.shareCount ? item.data.shareCount : 0 }}</span>
                  </div>
                </div>
                <div class="num">

                  <div class="numDiv">
                    <span>收藏</span>
                    <span>{{ item.data.collectCount }}</span>·
                  </div>
                  <div class="numDiv">
                    <span>预览</span>
                    <span>{{ item.data.previewCount }}</span>
                  </div>
                </div>
              </div>

              <div :class="'domBtn domBtn' + item.id" :id="'domBtn' + item.id">
                <!-- <img src="@/assets/images/gb.png" alt="" class="domBtnGb" @click.stop="operationClick(item, 'hide')"> -->
                <div @click.stop="userWorksPinned(item, index)"> {{ item.pinnedFlag == 0 ? "置顶" : "取消置顶" }}</div>
                <div @click.stop="userWorksPrivate(item, index)"> {{ item.data.privacyFlag == 0 ? "仅我可见" : "设为公开" }}
                </div>
                <div @click.stop="riskTipsShow(item, index)" v-if="item.displayStatus == 'rejected'">作品申述</div>
                <div @click.stop="details(item)">查看详情</div>
                <div @click.stop="Deleteopen(item,index)">删除作品</div>
                <div @click.stop="operationClick(item, 'hide')">取消</div>
              </div>
            </div>
            <div v-if='draftsListNullShow' class="draftsListNull">
              暂无作品
            </div>
          </div>

        </div>

      </div>
      <el-dialog :title="titleVideo" :visible.sync="dialogVideo" width="530px" style="text-align: center;">
        <video v-if="dialogVideo" class="videoDom" :src="dialogVideoUrl" controls></video>
      </el-dialog>
      <el-dialog title="作品申述" :visible.sync="riskTipsVisible" width="30%" :close-on-click-modal="false"
        :close-on-press-escape="false" top="16%">
        <el-input type="textarea" :rows="10" placeholder="请输入作品申述原因" v-model="riskTipsContent">
        </el-input>
        <span slot="footer" class="dialog-footer">
          <el-button @click="riskTipsVisible = false">取 消</el-button>
          <el-button type="primary" @click="bizAppealUserAppeal()">确 定</el-button>
        </span>
      </el-dialog>
      <el-dialog title="违规信息" :visible.sync="violationInfo" :close-on-click-modal="false" :close-on-press-escape="false"
        top="5%">
        <div style="height: 900px; overflow: auto;">

          <div class="violationTitle" v-if="violationInfoList.image">
            {{ queryParams.dataType == 'shortVideo' ? '视频封面' : '封面/内容图片' }} </div>
          <div class="violationImg" v-if="violationInfoList.image">
            <div class="violationImgDom" v-for="(item, index) in violationInfoList.image">
              <img :src="item.content" alt="">
              <span class="riskLevelC" v-if="item.riskLevel != 'none'">违规原因： {{ item.riskTips }}</span>
            </div>
          </div>
          <div class="violationContent" v-if="violationInfoList.text">
            <div class="" v-for="(item, index) in violationInfoList.text">

              <div class="violationTitle" v-if="item.itemKey == 'title'">
                {{ queryParams.dataType == 'shortVideo' ? '视频标题' : '文章标题' }}
              </div>
              <div class="violationTitle" v-if="item.itemKey == 'content'">
                {{ queryParams.dataType == 'shortVideo' ? '视频内容' : '文章内容' }}
              </div>
              <span class="riskLevelC" v-if="item.riskLevel != 'none'">违规原因：{{ item.riskTips }}</span>
              <div v-if="item.itemKey == 'title'">{{ item.content }}</div>
              <div class="vContent" v-if="item.itemKey == 'content'" v-html="item.content"></div>
            </div>
          </div>

          <div class="violationContent" v-if="violationInfoList.video">
            <div class="" v-for="(item, index) in violationInfoList.video">
              <div class="violationTitle">视频内容</div>
              <span class="riskLevelC" v-if="item.riskLevel != 'none'">违规原因：{{ item.riskTips }}</span>
              <video controls :src="violationItem.data.playUrl" style="width: 23%;"></video>
            </div>
          </div>
        </div>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import {
  userWorksList,
  userWorksDelete,
  userWorksPinned,
  userWorksPrivate,
  bizAppealUserAppeal
} from "@/api/articleRelease/index";
import moment from "moment";
export default {
  data() {
    return {
      rawHtml: '<p style="color: red;">这是红色的文本。</p>',
      riskTipsVisible: false,
      riskTipsContent: "",
      layout: "total, sizes, prev, pager, next, jumper",
      total: 100,
      groupdraftsShow: false,
      formDialogRef: "",
      excelUploadRef: "",
      dataList: [],
      loading: false,
      pagination: null,
      draftsListNullShow: false,
      dialogVideo: false,
      dialogVideoUrl: '',
      titleVideo: "",
      listTabName: "",
      violationInfo: false,
      violationInfoList: {
        image: [],
        text: [], 
        video: [],
      },

      auditStatusList: [
        {
          id: "",
          name: "全部"
        },
        {
          id: "published",
          name: "已发布"
        },
        {
          id: "pending",
          name: "审核中"
        },
        // {
        //   id: "violated",
        //   name: "涉嫌违规"
        // },
        {
          id: "rejected",
          name: "未通过"
        },
        {
          id: "1",
          name: "仅我可见"
        },
      ],
      categoryidDescList: [
        {
          id: "article",
          name: "文章"
        },
        {
          id: "shortVideo",
          name: "视频"
        }
      ],
      tebShowId: '',
      listData: [],
      listDataNum: 0,
      cursor: null,
      commandName: '全部',
      riskTipsData: null,
      riskTipsDataIndex: null,
      violationItem: null,
      queryParams: {
        isMine: true,
        title: "",
        authorId: "",
        dataType: 'article',
        current: 1,
        size: 30,
        cursor: null,
        myElement: null
      }
    };
  },
  created() { },
  mounted() {
    this.userWorksList();
  },
  methods: {
    violationInfoDom(item) {
      console.log(item)
      this.violationInfo = true
      this.violationItem = item
      this.violationInfoList = item.sensitiveDetails
        this.violationInfoList.text.sort((a, b) => {
        // 让 title 为 'Apple' 的项排在前面
        if (a.itemKey === 'title' && b.itemKey !== 'title') {
          return -1;
        } else if (a.itemKey !== 'title' && b.itemKey === 'title') {
          return 1;
        } 
      });
    },
    riskTipsShow(item, index) {
      if (!item.isAppealed) {
        this.riskTipsVisible = true
        this.riskTipsData = item
        this.riskTipsDataIndex = index
        this.operationClick(item, 'hide')
      } else {
        this.$message({
          type: "warning",
          message: "每个作品只能申述一次"
        });
      }

    },
    bizAppealUserAppeal() {
      if (this.riskTipsContent == '') {
        this.$message({
          type: "warning",
          message: "请输入申述原因"
        });
        return false
      }
      let data = {
        bizId: this.riskTipsData.data.id,
        appealContent: this.riskTipsContent,
        dataType: this.riskTipsData.dataType,

      }
      bizAppealUserAppeal(data).then(res => {
        if (res.data == true) {
          this.$message({
            type: "success",
            message: "申述成功"
          });
          this.riskTipsVisible = false
          this.riskTipsContent = ''
          this.listData[this.riskTipsDataIndex].displayStatus = 'pending'
          // this.userWorksList(this.riskTipsData.dataType);
        }
      });
    },
    listTabClick(item) {
      this.listTabName = item.id
      this.listData = []
      this.loading = true
      this.queryParams.current = 1
      this.queryParams.cursor = null
      this.cursor = null
      this.listTabWorksList(item);

    },
    listTabWorksList(item) {
      userWorksList(this.queryParams).then(res => {
        this.cursor = res.data.cursor
        for (let i of res.data.records) {
          if (this.listTabName == i.displayStatus) {
            this.listData.push(i)
          }
          else if (item.id == i.data.privacyFlag) {
            this.listData.push(i)
          }
        }
        this.listDataNum = this.listData.length
        if (this.listData.length == 0) {
          this.draftsListNullShow = true
        } else {
          this.draftsListNullShow = false
        }
        if (this.listData.length < 7 && res.data.records.length > 0) {
          this.loading = true
          this.queryParams.current++
          this.queryParams.cursor = this.cursor
          this.listTabWorksList(item);
        } else {
          this.loading = false
        }
      });
    },
    handleScroll() {
      this.checkScrollToBottom();
    },
    checkScrollToBottom() {

      const container = this.$refs.scrollContainer;
      if (container) {
        const scrollTop = container.scrollTop;
        const scrollHeight = container.scrollHeight;
        const clientHeight = container.clientHeight;
        if (Math.round(scrollTop + clientHeight + 10) >= scrollHeight) {
          if (this.queryParams.cursor != this.cursor) {
            this.queryParams.current++
            this.queryParams.cursor = this.cursor
            this.userWorksList();
          }

          // 执行你的逻辑，例如加载更多数据等
        }
      }
    },
    handleCommand(command) {
      this.queryParams.dataType = command.name
      this.queryParams.current = 1
      this.queryParams.cursor = null
      this.listData = []
      this.listTabName = ''
      if (command.name == 'article') {
        this.commandName = '文章'
      } else if (command == 'shortVideo') {
        this.commandName = '视频'
      } else {
        this.commandName = '全部'
      }

      this.userWorksList()
    },
    userWorksPrivate(item, index) {
      //私密我的作品
      const data = {
        privacyFlag: item.data.privacyFlag == 0 ? 1 : 0,
        id: item.id,
        dataType: item.dataType
      };
      userWorksPrivate(data).then(res => {
        this.$message({
          type: "success",
          message: item.data.privacyFlag == 0 ? "设置私密成功" : "设置公开成功"
        });
        item.data.privacyFlag == 0 ? this.listData[index].data.privacyFlag = 1 : this.listData[index].data.privacyFlag = 0
      });
    },
    userWorksPinned(item, index) {
      if (this.myElement != null) {
        this.myElement.style.height = 0;
      }
      //置顶我的作品
      const data = {
        pinnedFlag: item.pinnedFlag == 0 ? 1 : 0,
        id: item.id
      };
      userWorksPinned(data).then(res => {
        this.$message({
          type: "success",
          message: "设置成功"
        });
        this.queryParams.current = 1
        this.queryParams.cursor = null
        this.queryParams.size = 20
        this.userWorksList('Pinned')
      });
    },
    userWorksList(type) {
      this.loading = true
      userWorksList(this.queryParams).then(res => {
        this.total = res.total || 0;
        for (let [index, item] of res.data.records.entries()) {
          item['serialNumber'] = index
        }
        if (type) {
          this.listData = res.data.records;
        }
        else {
          if (this.listTabName == '') {
            this.listData = this.listData.concat(res.data.records);
          } else {
            for (let item of res.data.records) {
              if (this.listTabName == item.displayStatus) {
                this.listData.push(item)
              }
            }
          }
        }

        this.listDataNum = this.listData.length
        this.cursor = res.data.cursor
        this.loading = false
        if (this.listData.length == 0) {
          this.draftsListNullShow = true
        } else {
          this.draftsListNullShow = false
        }
      });
    },
    Deleteopen(item,index) {
      this.$confirm("此操作将永久删除该作品, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          this.userWorksDelete(item,index);
          this.$message({
            type: "success",
            message: "删除成功!"
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });
    },
    userWorksDelete(item,index) {
      const data = {
        ids: [item.id]
      };
      userWorksDelete(data).then(res => {
        if(!this.groupdraftsShow){
          this.operationClick(item, 'hide')
        }
        this.listData.splice(index,1)
      });
    },
    formatDate(timestamp) {
      return moment(timestamp).format("YYYY-MM-DD HH:mm:ss"); // 注意：同上，如果是秒则需要乘以1000
    },
    details(row) {
      if (row.data.dataType == "article") {
        this.$router.push({ path: '/articleDetails', query: { id: row.data.id } })
      } else {
        this.$router.push({ path: '/videoDetails', query: { id: row.data.id } })
      }

      ;
    },
    operationClick(item, type) {
      let domBtn = document.querySelectorAll('.domBtn')
      domBtn.forEach(div => {
        div.style.height = 0;
      });
      if (type == 'show') {
        // document.getElementsByClassName('domBtn').style.height=0
        this.myElement = document.getElementById('domBtn' + item.id);
        this.myElement.style.height = '100%';
      } else {
        console.log(item.id)
        this.myElement = document.getElementById('domBtn' + item.id);
        this.myElement.style.height = '0';
      }

    },
    playVideo(item) {
      this.dialogVideo = true
      this.titleVideo = item.data.title
      this.dialogVideoUrl = item.data.playUrl
    },
    handleQuery() {
      this.userWorksList();
    },
    resetQuery() { },
    exportExcel() { },
    handleSizeChange() { },
    handleCurrentChange() { }

  }
};
</script>
<style lang="scss" scoped>
.draftsTitle {
  border-bottom: 1px solid #e3e3e3;
  padding: 15px 20px;
  font-size: 18px;
}

.domContainer {
  padding-left: 20px;
  padding-right: 20px;
}

.draftsTop {
  padding: 0 1.5%;

  .draftsNum {
    width: 100%;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;

    span {
      color: #666;
    }
  }

  ::v-deep .el-tabs__nav-wrap::after {
    background: none
  }

  ::v-deep .el-tabs__item {
    font-size: 16px;
  }
}

.draftsDom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 16px;
  border-bottom: 1px solid #DDDDDD;
  margin-bottom: 15px;
  color: #666;
  position: relative;
  cursor: pointer;

  p {
    color: #666;
  }

  h4 {
    font-size: 16px;
    color: #000;
    margin-top: 0;
    margin-bottom: 16px;
    width: 80%;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    /* 限制显示的行数为3 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .draftsDomLeft {
    display: flex;
    position: relative;

    .draftsDomLeftImg {
      width: 138px;
      height: 104px;
      border-radius: 4px 4px 4px 4px;
      border: 1px solid #DDDDDD;
      background-color: #e3e3e3;
      margin-right: 20px;
      overflow: hidden;
      display: flex;
      align-items: center;
      position: relative;

      video {
        width: 100%;
      }

      >img {
        width: 100%;
        background-color: #e3e3e3;
      }

      .videoImg {
        width: 100%;
        position: absolute;
        height: 100%;

        .imgB {
          width: 100%;
          height: 100%;
        }

        .frame {
          width: 22px;
          height: 22px;
          position: absolute;
          z-index: 33;
          left: 42%;
          top: 40%;
        }
      }
    }

    .draftsType {
      color: #2e5cf6;
      display: flex;
      align-items: center;

      span {
        font-size: 14px;
        margin-right: 15px;

        b {
          color: #999 !important;
        }
      }

    }

    .draftsCon {
      width: 400px;
      display: -webkit-box;
      -webkit-line-clamp: 1;
      font-size: 12px;
      /* 限制显示的行数为3 */
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
    }

  }

  .draftsText {
    height: 100%;

    span {
      font-size: 12px;
    }

    .privacyFlag {
      background-color: #F5F5F5;
      color: #999999;
      width: 56px;
      height: 16px;
      padding: 2px;
      text-align: center;
      line-height: 12px;
      border-radius: 4px 4px 4px 4px;
      font-size: 10px !important;
    }

    div {
      margin-bottom: 10px;
    }
  }

  .draftsDetails {
    cursor: pointer;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-direction: column;

    .el-button {
      width: auto;
      margin-left: 10px;
      color: #333;
      font-size: 16px;
    }



    .det {
      margin-bottom: 0;
    }

    .draftsBtn {
      display: flex;
      position: absolute;
      bottom: 10px;
    }

    .draftsTime {
      position: absolute;
      color: #666666;
      top: 15px;
      font-size: 12px;
    }
  }
}

.elFormItem-R {
  float: right;
  color: #2e5cf6;
  cursor: pointer;
}

.groupdrafts {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  overflow: auto;
  height: calc(100% - 150px);
  padding-left: .4%;

  .groupdraftsDom {
    width: 18%;
    height: calc(20vw);
    min-height: 380px;
    background: #fff;
    margin: 1%;
    box-shadow: 0px 4px 7px 0px rgba(0, 0, 0, 0.06);
    border-radius: 4px 4px 4px 4px;
    position: relative;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 2%;

    .draftsType {
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: flex-start;


    }

    .timestamp {
      color: #999;
      font-size: 12px;
    }

    .draftsNum {
      width: 100%;
      position: absolute;
      margin-bottom: 0px;
      bottom: 0;
      font-size: 12px;
      padding: 0;

    }

    .privacyFlag {
      background: #F5F5F5;
      border-radius: 4px 4px 4px 4px;
      color: #999999;
      padding: 4px 8px;
      font-size: 10px;
      margin-right: 5px;
    }

    .draftsCon {
      width: 100%;
      display: -webkit-box;
      -webkit-line-clamp: 1;
      font-size: 12px;
      /* 限制显示的行数为3 */
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      color: #666666;
    }

    .title {
      font-size: 16px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      /* 限制显示的行数为3 */
      line-height: 21px;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      text-align: left;
      color: #000;
    }

    >div {
      padding: 0px 15px;
      margin-bottom: 8px;
    }

    .num {
      font-size: 12px;
      color: #999;
      margin: 8px auto;
      position: relative;
      left: 5%;
    }

    .domImg {
      width: 100%;
      height: 55%;
      padding: 0;
      overflow: hidden;
      background-color: #000;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;

      video {
        width: 100%;
      }

      img {
        width: 100%;
        margin-right: 0 !important;
      }

      .frame {
        width: 40px;
        height: 40px;
        position: absolute;
        z-index: 9;
      }
    }

    .num {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-start;

      .numDiv {
        display: flex;
        width: 33%;
        text-align: center;

        span {
          display: block;
          text-align: right;
        }

      }
    }

    .numDiv span:nth-child(2) {
      width: 50%;
      text-align: center;
    }

  }

  // .groupdraftsDom:nth-child(5n) {
  //   margin-right: 0%;
  // }
}

.draftsListNull {
  text-align: center;
  color: #999;
  margin-top: 20%;
  margin: auto;
}

.draftsTeb {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  border: 1px solid #eeeeee;
  width: 160px;
  border-radius: 4px 4px 4px 4px;
  padding: 8px 8px;
  font-size: 14px;
  color: #999999;

  ::v-deep .el-dropdown {
    color: #999999;
    width: 110px;

    span {
      color: #333333;
      margin-left: 5px;
      width: 100%;
      display: block;
      cursor: pointer;

      i {
        float: right;
        color: #999999;
        font-size: 16px;
        margin-right: 2px;
      }
    }
  }

  .draftsTebDom {
    display: flex;
    align-items: center;
    margin-left: 10px;

    .draftsTebItem {
      margin: 0 10px;
      color: #999999;
      cursor: pointer;
    }

    .tebItemShow {
      color: #0052d9;
    }
  }
}



.groupdraftsBtn {
  float: right;
  position: relative;
  top: -50px;
  font-size: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;

  img {
    width: 18px;
    height: 18px;
    margin-right: 5px;

  }
}

.operation {
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0px 0px 0px 0px;
  position: absolute;
  top: 3%;
  right: 2%;
  z-index: 2;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
}

.domBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 0px 0px 0px 0px;
  width: 100%;
  height: 0;
  overflow: hidden;
  z-index: 99;
  top: 0;
  flex-direction: column;

  .domBtnGb {
    width: 20px;
    position: absolute;
    z-index: 9;
    top: 10px;
    right: 10px;
    cursor: pointer;
  }

  >div {
    width: 80px;
    height: 30px;
    line-height: 30px;
    background: #FFFFFF;
    border-radius: 4px 4px 4px 4px;
    font-size: 12px;
    border: 1px solid #FFFFFF;
    color: #0052D9;
    text-align: center;
    margin: 5px auto;
    cursor: pointer;
  }

  >div:hover {
    background-color: #EEEEEE;
  }

  >div:last-child {
    background: none;
    color: #fff;
  }

  >div:last-child:hover {
    background-color: rgba(0, 0, 0, 0.2);
  }
}

.videoDom {
  width: 100%;
  margin: auto;
}

.listTab {
  display: flex;
  margin: 20px 0;
  margin-top: 10px;
  font-size: 14px;

  div {
    margin-right: 15px;
    cursor: pointer;
  }
}

.listTabShow {
  color: #0052d9;
}

.draftsConCount {
  span {
    margin-right: 10px;
  }
}

.riskTips {
  font-size: 11px;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* 限制显示的行数为3 */
  -webkit-box-orient: vertical;
  line-height: 18px;
  overflow: hidden;
  cursor: pointer;
}
.riskTips:hover{
  color: #000;
}
.violationTitle {
  padding: 5px;
  color: #000;
  font-weight: bold;
}

.violationImg {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;

  .violationImgDom {
    border: 1px solid #f4f4f4;
    width: 23%;
    height: 300px;
    overflow: hidden;
    margin: 5px;
    position: relative;
    display: flex;
    align-items: center;
    background-color: #000;

    img {
      width: 100%;
    }

    span {
      position: absolute;
      bottom: 0;
      color: red;
      left: 0;
      width: 100%;
      background: rgb(0, 0, 0, .7);
      padding: 10px;
    }
  }
}

.violationContent {
  padding: 5px;

  >div {
    margin-bottom: 20px;

    .violationTitle {
      padding: 0;
      margin-bottom: 10px;
    }

    .riskLevelC {
      color: red;
    }

    span {

      margin-bottom: 5px;
      display: block;
    }
  }
}

.vContent {
  width: 100%;
  overflow: hidden;

  ::v-deep p {
    img {
      width: auto;
      margin: 10px 0;
    }
  }

}

@media screen and (max-width: 2280px) {
  .groupdrafts .groupdraftsDom .domImg {

    height: 45%;

  }
}
</style>
